﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Should;

namespace CashFlow.Entities.Tests
{
	[TestClass]
	public class DateRangeTest
	{
		#region Fields and properties
		
		private DateRange range = 
			new DateRange(new DateTime(2011, 1, 1), new DateTime(2012, 1, 1));
		
		#endregion

		#region Contains

		[TestMethod]
		public void Contains_Returns_True_For_Date_20110115_In_20110101_And_20120101()
		{
			var date = new DateTime(2011, 1, 15);

			var expected = range.Contains(date);

			expected.ShouldBeTrue();
		}

		[TestMethod]
		public void Contains_Returns_True_For_Date_Equal_To_MaxDate()
		{
			var date = range.MaxDate;

			var expected = range.Contains(date);

			expected.ShouldBeTrue();
		}

		[TestMethod]
		public void Contains_Returns_True_For_Date_Equal_To_MinDate()
		{
			var date = range.MinDate;

			var expected = range.Contains(date);

			expected.ShouldBeTrue();
		}

		[TestMethod]
		public void Contains_Returns_False_For_Date_20100115_In_20110101_And_20120101()
		{
			var date = new DateTime(2010, 1, 15);

			var expected = range.Contains(date);

			expected.ShouldBeFalse();
		}

		[TestMethod]
		public void Contains_Returns_False_For_Date_20130115_In_20110101_And_20120101()
		{
			var date = new DateTime(2013, 1, 15);

			var expected = range.Contains(date);

			expected.ShouldBeFalse();
		}
		#endregion	
	}
}
